package com.example.demo.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class Res {
    private Integer code;
    private String msg;
    private Object data;

    public static Res success(String msg, Object data) {
        return new Res(200, msg, data);
    }
    public static Res success(String msg) {
        return new Res(200, msg, null);
    }
    public static Res fail(String msg, Object data) {
        return new Res(500, msg, data);
    }
    public static Res fail(String msg) {
        return new Res(500, msg, null);
    }
}
